const express = require('express');
const router = express.Router();
const candidateController = require('../controllers/candidate.controller');
const { authenticate, authorize } = require('../middleware/auth');

// 公开查询路由（无需认证）
router.get('/info', candidateController.getCandidateInfo);

// 管理员路由（需认证和管理员权限）
router.get('/', authenticate, authorize('admin'), candidateController.getCandidateList);
router.put('/:id/status', authenticate, authorize('admin'), candidateController.updateCandidateStatus);

module.exports = router;